package com.liu.config;


import com.liu.condition.MySqlCondition;
import com.liu.service.UserService;
import com.liu.service.impl.UserServiceMysqlImpl;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Conditional;
import org.springframework.context.annotation.Configuration;

@Configuration
public class Appconfig {


    @Bean
    //@Conditional(MySqlCondition.class)//如果条件MySqlCondition返回true 向容器中注入 否则不注入
    public UserService userService(){
        return new UserServiceMysqlImpl();
    }




}
